package org.example.rtc.model.entity.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class R <T>{
    private String code;
    private String message;
    private T data;

    public static <T> R<T> success(T data) {
        return new R<>("200", "Success", data);
    }

    public static <T> R<T> success() {
        return new R<>("200", "Success",null);
    }

    public static <T> R<T> error(String message) {
        return new R<>("0", message,null);
    }
}
